package ar.com.cooker.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
/**
 * Obejto BO ingrediente.
 * @author c02536
 *
 */
@Entity
@Table(name = "ck_Ingredient")
public class Ingredient implements Serializable{

	private static final long serialVersionUID = -3000655742197236231L;

	@Id
	@GeneratedValue
	@Column(name="id_ingredient")
	private Integer id;
	
	@Column(length = 100)
	private String name;
	
	@ManyToOne(targetEntity = UnitType.class, fetch = FetchType.EAGER)
	@JoinColumn(name = "id_unit_type_fk", referencedColumnName = "id_unit_type", nullable = true)
	private UnitType unitType;
	
	@ManyToOne(targetEntity = IngredientType.class, fetch = FetchType.EAGER)
	@JoinColumn(name = "id_ingredient_type_fk", referencedColumnName = "id_ingredient_type", nullable = true)
	private IngredientType ingredientType;
	
	private Integer amount;
	
	private Float price;
	
	@Column(length = 100)
	private String additionalDescription;

	public Ingredient() {
	}
	
	public Ingredient(String name, UnitType unitType,
			IngredientType ingredientType, Integer amount, Float price,
			String additionalDescription) {
		this.name = name;
		this.unitType = unitType;
		this.ingredientType = ingredientType;
		this.amount = amount;
		this.price = price;
		this.additionalDescription = additionalDescription;
	}



	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public UnitType getUnitType() {
		return unitType;
	}

	public void setUnitType(UnitType unitType) {
		this.unitType = unitType;
	}

	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	public Float getPrice() {
		return price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	public void setIngredientType(IngredientType ingredientType) {
		this.ingredientType = ingredientType;
	}

	public IngredientType getIngredientType() {
		return ingredientType;
	}

	public void setAdditionalDescription(String additionalDescription) {
		this.additionalDescription = additionalDescription;
	}

	public String getAdditionalDescription() {
		return additionalDescription;
	}
}
